package com.unionx.unionxuf.common;

import java.io.Serializable;
import java.util.Map;

public class Page implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int pagenum=1;
	private int pagesize=5;
	private int totalnum;
	private int totalpage;
	private int startpos;
	private boolean haslast;//是否有上一个
	private boolean hasnext;
	private Map<String,String> params; //查询参数的容器 
	public int getPagenum() {
		return pagenum;
	}
	public void setPagenum(int pagenum) {
		this.pagenum = pagenum;
	}
	public int getPagesize() {
		return pagesize;
	}
	public void setPagesize(int pagesize) {
		this.pagesize = pagesize;
	}
	public int getTotalnum() {
		return totalnum;
	}
	public void setTotalnum(int totalnum) {
		this.totalnum = totalnum;
	}
	public int getTotalpage() {
		if(totalnum%pagesize==0){
			return totalnum/pagesize;
		}else{
			return totalnum/pagesize+1;
		}
	}
	public void setTotalpage(int totalpage) {
		this.totalpage = totalpage;
	}
	public int getStartpos() {
		return (pagenum-1)*pagesize;
	}
	public void setStartpos(int startpos) {
		this.startpos = startpos;
	}
	public boolean isHaslast() {
		return pagenum>1;
	}
	public void setHaslast(boolean haslast) {
		this.haslast = haslast;
	}
	public boolean isHasnext() {
		return pagenum<totalpage;
	}
	public void setHasnext(boolean hasnext) {
		this.hasnext = hasnext;
	}
	public Map<String, String> getParams() {
		return params;
	}
	public void setParams(Map<String, String> params) {
		this.params = params;
	}
	

}

